import { onMounted } from 'vue'
import pinia from '../store'
import useUserStore from '../store/modules/user.ts'
const userStore = useUserStore(pinia)
export const isHasButton = (app: any) => {
  app.directive('has', {
    mounted(el: any, options: any) {
      console.log('v-has 启动', options.value)
      if (!userStore.buttons.includes(options.value)) {
        el.parentNode.removeChild(el)
      }
    },
  })
}
